Technical Q&A QTW89
Calling InitializeQTML from DLL Main

Q Is there a known problem calling the QuickTime 3 for Windows InitializeQTML(0) function from the DllMain procedure of a DLL?

A Yes, but there's more to it than that. It's a known problem on Windows with calling LoadLibrary or FreeLibrary (or any of several other APIs) from the DllMain procedure of a DLL. The basic rule of thumb on Windows is: "Don't do anything significant in your DLL Main." Moreover, don't *ever* call DLL-related APIs.

Instead, I would recommend adding an Initialize call to your DLL that calls InitializeQTML, and a Terminate call that calls TerminateQTML. That avoids the problem entirely.

[Sep 21 1998]


Developer Documentation | Technical Notes | Development Kits | Sample Code